home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10227 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: compilers
  5. Date: Sat, 16 Mar 96 01:42:34 GMT
  6. Organization: none
  7. Message-ID: <826940554snz@genesis.demon.co.uk>
  8. References: <4iburm$aps@airdmhor.gen.nz> <DoBvF6.GG5@iquest.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <DoBvF6.GG5@iquest.net> dlmiller@iquest.net "Doug Miller" writes:
  15.  
  16. >gumboot@airdmhor.gen.nz (Simon Hosie) wrote:
  17. >+  Does anyone know of a compiler that can take
  18. >+
  19. >+for (;;)
  20. >+{
  21. >+    Stuff(1);
  22. >+    if (Cond)
  23. >+        break;
  24. >+    Stuff(2);
  25. >+}
  26. >+
  27. >+  and make
  28. >+
  29. >+goto EntryPoint;
  30. >+do
  31. >+{
  32. >+    Stuff(2);
  33. >+EntryPoint:
  34. >+    Stuff(1);
  35. >+} while (Cond);
  36. >
  37. >A possibly more important question is why you would want it to, since the first
  38. > form is vastly
  39. >more comprehensible.
  40.  
  41. And any reasonable optimising compiler will perform whatever loop
  42. transformations are necessary to generate efficient code for the first
  43. version. Maybe that was the question.
  44.  
  45. -- 
  46. -----------------------------------------
  47. Lawrence Kirby | fred@genesis.demon.co.uk
  48. Wilts, England | 70734.126@compuserve.com
  49. -----------------------------------------
  50.